package com.example.repeatsubmit.enums;

import com.example.repeatsubmit.policy.RepeatPolicy;
import com.example.repeatsubmit.policy.conretepolicy.LocalCachTimeOutRefuse;
import com.example.repeatsubmit.policy.conretepolicy.RedisTimeOutRefuse;
import com.example.repeatsubmit.policy.conretepolicy.TimeInnerRefuse;
import com.example.repeatsubmit.utils.ApplicationContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author caoqianhuan
 * @date 2022/8/19
 * @Description:
 */

public enum RepeatSubmitPolicyEnum {
    TIME_INNER_REFUSE(new TimeInnerRefuse()),
    REDIS_LOCK(new RedisTimeOutRefuse()),
    CACEH_LOCK(new LocalCachTimeOutRefuse());
    //DATABASE_REPEAT_REFUSE();

    private RepeatPolicy repeatPolicy;


    private  RepeatSubmitPolicyEnum(RepeatPolicy repeatPolicy) {
        this.repeatPolicy = repeatPolicy;
    }

    public RepeatPolicy getRepeatPolicy() {
        return repeatPolicy;
    }
}
